export default {
    namespaced: true,
    state: {
        token: window.sessionStorage.getItem('token'),
        isAuthenticated: window.sessionStorage.getItem('isAuthenticated'),
    },
    mutations: {
        storeToken(state, token) {
            state.token = token
            window.sessionStorage.setItem('token', token)
            window.sessionStorage.setItem('isAuthenticated', true)
            state.isAuthenticated = true
        },
    },
    actions: {
        storeToken(store, val) {
            store.commit('storeToken', val)
        }
    }
}